package com.ryskoo.cms.decorate.channel.repository;

import com.ryskoo.cms.decorate.channel.domain.ChannelPO;
import com.ryskoo.common.constant.CacheConstant;
import com.ryskoo.framework.core.repository.BasicRedisImpl;
import com.ryskoo.framework.core.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;

/**
 * @author thq
 * @data 2018-05-03
 */
@Primary
@Repository
public class ChannelRedisImpl extends BasicRedisImpl<ChannelPO> implements IChannelRepository {

    @Autowired
    private RedisUtil redisClient;

    @Autowired
    private IChannelRepository channelRepository;

    @PostConstruct
    public void init() {
        this.setRedisClient(redisClient);
        this.setDao(channelRepository);
    }

    public ChannelRedisImpl() {
        super(CacheConstant.CMS_DECORATE_CHANNEL_KEY);
    }
}
